const config = require('../../myconfig').config
function register(code) {  
  wx.request({  
    url: config.serverApi + 'register',  
    method: "POST",  
    data: {  
      "code": code  
    },  
    success: res => {  
      console.log("注册成功",res);
      wx.setStorage({
        key:"session",
      data:res.data.session_id
    })
      wx.setStorage({key:"token",
      data:res.data.token
    })  
    },  
    fail: res => {  
      console.log("注册失败", res);  
    }  
  });  
}
module.exports={
  register
}